import {request} from "@@/plugin-request/request";

/** 获取分类信息 GET /Admin/admin/category/category */
export async function getCategorySearch(params?: Admin.CategoryQueryParams, options?: { [key: string]: any }) {
  return request<Admin.PageQueryVO<Admin.CategoryResult>>('/api/admin/category/category', {
    method: 'GET',
    params:params,
    ...(options || {}),
  });
}
/** 保存分类信息 POST /Admin/admin/category/save */
export async function saveCategory(params:Admin.CategoryResult, options?: { [key: string]: any }){
  return request<boolean>('/api/admin/category/save',{
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data:params,
    ...(options || {}),
  })
}
/** 修改分类信息 POST /Admin/admin/category/update */
export async function updateCategory(params:Admin.CategoryResult, options?: { [key: string]: any }){
  return request<boolean>('/api/admin/category/update',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data:params,
    ...(options||{}),
  })
}
/** 删除分类信息 GET /Admin/admin/category/delCategory/{id} */
export async function deleteCategory(id:number,options?: { [key: string]: any }) {
  return request<boolean>('/api/admin/category/delCategory/'+id,{
    method: 'GET',
    ...(options||{}),
  })
}
